# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-coveralls
pkgname=('python2-coveralls' 'python-coveralls')
_pkgname=coveralls
pkgver=2.1.2
pkgrel=8
pkgdesc='Show coverage stats online via coveralls.io.'
arch=('any')
url='https://github.com/coveralls-clients/coveralls-python'
license=('MIT')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('a908909a0117faa982d8305c79cde05ec0a7ecf873a45564f56f7daf6f954d2ddc59d9cc102b9baafe92d74790a41201f072f15a8119efe3e63ac5f9042735e9')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-coveralls() {
  depends=('python2' 'python2-coverage' 'python2-docopt' 'python2-requests')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  for i in "$pkgdir/usr/bin/"*; do
    mv $i "${i}2"
  done
}

package_python-coveralls() {
  depends=('python' 'python-coverage' 'python-docopt' 'python-requests')

  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

